package com.wc.alorithm_blue_bridge._模拟.购物单;

/**
 * @Author congege
 * @Description
 * @Date Created in 2023/9/16-21:38
 * https://www.lanqiao.cn/problems/645/learning/?page=1&first_category_id=1
 */
public class Main {
    public static void main(String[] args) {
        String s = "****     180.90       88折\n" +
                "****      10.25       65折\n" +
                "****      56.14        9折\n" +
                "****     104.65        9折\n" +
                "****     100.30       88折\n" +
                "****     297.15        半价\n" +
                "****      26.75       65折\n" +
                "****     130.62        半价\n" +
                "****     240.28       58折\n" +
                "****     270.62        8折\n" +
                "****     115.87       88折\n" +
                "****     247.34       95折\n" +
                "****      73.21        9折\n" +
                "****     101.00        半价\n" +
                "****      79.54        半价\n" +
                "****     278.44        7折\n" +
                "****     199.26        半价\n" +
                "****      12.97        9折\n" +
                "****     166.30       78折\n" +
                "****     125.50       58折\n" +
                "****      84.98        9折\n" +
                "****     113.35       68折\n" +
                "****     166.57        半价\n" +
                "****      42.56        9折\n" +
                "****      81.90       95折\n" +
                "****     131.78        8折\n" +
                "****     255.89       78折\n" +
                "****     109.17        9折\n" +
                "****     146.69       68折\n" +
                "****     139.33       65折\n" +
                "****     141.16       78折\n" +
                "****     154.74        8折\n" +
                "****      59.42        8折\n" +
                "****      85.44       68折\n" +
                "****     293.70       88折\n" +
                "****     261.79       65折\n" +
                "****      11.30       88折\n" +
                "****     268.27       58折\n" +
                "****     128.29       88折\n" +
                "****     251.03        8折\n" +
                "****     208.39       75折\n" +
                "****     128.88       75折\n" +
                "****      62.06        9折\n" +
                "****     225.87       75折\n" +
                "****      12.89       75折\n" +
                "****      34.28       75折\n" +
                "****      62.16       58折\n" +
                "****     129.12        半价\n" +
                "****     218.37        半价\n" +
                "****     289.69        8折";
        s = s.replace("*", "");
        s = s.replace("     ", "");
        s = s.replace("半价", "5折");
        s = s.replace("折", "");
        String[] rows = s.split("\n");
        double sumPrice = 0;
        for (int i = 0; i < rows.length; i++) {
            String[] s1 = rows[i].split("  ");
            double price = Double.parseDouble(s1[0].trim());
            double discount;
            if (s1[1].trim().length() == 1) {
                discount = Double.parseDouble(s1[1].trim()) * 0.1;
            } else {
                discount = Double.parseDouble(s1[1].trim()) * 0.01;
            }

            sumPrice += discount * price;
        }

        int finalPrice = 100;
        while (sumPrice > finalPrice) {
            finalPrice += 100;
        }
        System.out.println(finalPrice);
    }
}
